﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Godot.core
{
    public class Reference : Object, System.IDisposable
    {
        public RID get_rid()
        {
            Resource res = (this as Resource);
            if (res != null)
                return res.get_rid();
            return new RID();
        }

        ~Reference() 
        {
            Dispose(false);
        }

        public void Dispose()
        {
            Dispose(true);
            System.GC.SuppressFinalize(this);
        }

        protected virtual void Dispose(bool disposing) {}
    }
}
